//
//  FFPayPwdUpdateNextVC.m
//  Pods
//
//  Created by tt on 2020/9/2.
//

#import "FFPayPwdUpdateNextVC.h"
#import <WuKongBase/WuKongBase.h>
@interface FFPayPwdUpdateNextVC ()

@property(nonatomic, strong) WKCorePasswordView *pv;

@property(nonatomic, strong) UILabel *titleLbl;

@end

@implementation FFPayPwdUpdateNextVC

- (void)viewDidLoad {
    [super viewDidLoad];
    _titleLbl =
    [[UILabel alloc] initWithFrame:CGRectMake(20, self.navigationBar.lim_bottom +  50, WKScreenWidth - 40, 0)];
    _titleLbl.numberOfLines = 0;
    _titleLbl.textAlignment = NSTextAlignmentCenter;
    [_titleLbl setFont:[[WKApp shared].config appFontOfSize:15.0f]];
    [_titleLbl setTextColor:[UIColor colorWithRed:155.0f/255.0 green:155.0/255.0 blue:155.0/255.0 alpha:1.0f]];
    _titleLbl.lineBreakMode = NSLineBreakByWordWrapping;

    [self.view addSubview:_titleLbl];
    
    if (_type == PasswordTypeSetPayPwd) { //  设置支付密码
      self.title = LLang(@"支付密码");
      [_titleLbl setText:LLang(@"设置支付密码,用于支付验证")];
    } else if (_type == PasswordTypeComfirSetPayPwd) {
      self.title = LLang(@"确认支付密码");
      [_titleLbl setText:LLang(@"确认支付密码,请再次输入支付密码")];
    }
     [_titleLbl sizeToFit];
    
    self.pv = [[WKCorePasswordView alloc]
    initWithFrame:CGRectMake(20, _titleLbl.lim_bottom + 20,
                             self.view.lim_width - 20 * 2, 50)];
    
    __weak typeof(self) weakSelf = self;
    self.pv.PasswordCompeleteBlock = ^(NSString *password) {
      if (weakSelf.passwordInputCompletion) {
        weakSelf.passwordInputCompletion(password);
      }
    };
    [self.pv beginInput];

    [self.view addSubview:self.pv];

    [self.view setBackgroundColor:[UIColor whiteColor]];
}

@end
